package com.lm.mongo.repository;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import com.lm.mongo.entry.User;

import java.util.List;

@Repository
public interface UserRepository extends MongoRepository<User, String> {

    // 按名字查询
    List<User> findByName(String name);

    // 按年龄区间查询
    List<User> findByAgeBetween(int min, int max);

    // 按城市模糊查询
    List<User> findByCityLike(String city);
}